#include <iostream>
#include <string>

using namespace std;


class stu
{
private:
    string name;
    int id;

public:
    stu(){}

    // 通过括号法
    stu(string m_name, int m_id)
    {
        name = m_name;
        id = m_id;
    }

public:
    void show()
    {
        cout << "姓名" << name << endl;
        cout << "学号" << id << endl;
    }
};


int main(int argc, char const *argv[])
{
    // 括号调用
    stu s1("唐三" , 10);

    s1.show();

    // 括号调用  s2 = s1
    stu s2(s1);
    s2.show();

    // 匿名对象
    stu s3 = stu("萧薰儿" , 11);
    s3.show();

    return 0;
}
